package com.esms.controller;

import com.esms.service.IEchartsService;
import com.esms.service.impl.EchartsServiceImpl;
import com.esms.vo.EchDepartmentSalary;
import com.esms.vo.EchEmployeeNums;
import com.esms.vo.EchMonthSalary;
import com.esms.vo.EchSalaryPercent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 图表统计Controller
 * @Author: lyy
 * @Description: 图表制作类
 * @Date: 22:24 2022/02/12
 **/
@Controller
public class EchartsController {
    @Autowired
    private IEchartsService echartsService;

    /**
     * 查看部门人数
     * @return
     */
    @RequestMapping(value = "/showEmployeeNums.do")
    @ResponseBody
    public Map<String,List<EchEmployeeNums>> showEmployeeNums(){
    
        return echartsService.getEmployeeNums();
    }

    /**
     * 查看部门工资
     * @param date
     * @return
     */
    @RequestMapping(value = "/showDepartmentSalary.do")
    @ResponseBody
    public Map<String,List<EchDepartmentSalary>> showDepartmentSalary(String date){
    
        return echartsService.getDepartmentSalary(date);
    }

    /**
     * 查看部门工资占比
     * @param date
     * @param state
     * @return
     */
    @RequestMapping(value = "/showSalaryPercent.do")
    @ResponseBody
    public Map<String,List<EchSalaryPercent>> showSalaryPercent(String date,int state){

        return  echartsService.getSalaryPercent(date,state);
    }

    /**
     * 查看各月的工资
     * @return
     */
    @RequestMapping(value = "/showMonthSalary.do")
    @ResponseBody
    public Map<String,List<EchMonthSalary>> showMonthSalary(){
       
        return echartsService.getMonthSalary();
    }

}
